﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="CoolCode.Web.UI.Views.Admin.Users" %>

<%@ Register Src="~/Controls/MenuInUsers.ascx" TagName="MenuInUsers" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="tsmAjax" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Content/js/Common.js" />
        </Scripts>
    </ajaxToolkit:ToolkitScriptManager>
    <cc:Loading ID="Loading1" runat="server"></cc:Loading>
    <asp:UpdatePanel ID="udpHeader" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:MultiView ID="mvwMain" runat="server" ActiveViewIndex="0">
                <asp:View ID="vwMaster" runat="server">
                    <!--Title -->
                    <div class="HeaderTitle">
                        <asp:Label ID="SCRHDR" runat="server" Text="用户管理"></asp:Label>
                    </div>
                    <asp:Panel ID="pnlMaster" runat="server" CssClass="HeaderSearch">
                        <table cellspacing="5" width="100%">
                            <tr>
                                <td align="right" style="width: 80px; min-width: 80px;">
                                    <asp:Label ID="lblUser" runat="server" Text="用户"></asp:Label>
                                </td>
                                <td align="left">
                                    <asp:TextBox ID="txtUser" runat="server" CssClass="FlatTextBox" Width="200px"></asp:TextBox>
                                    <ajaxToolkit:AutoCompleteExtender ID="aceSearchSuggest" runat="server" SkinID="Suggest"
                                        TargetControlID="txtUser" ServicePath="~/WebServices/UserService.asmx" ServiceMethod="ListUsers" />
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <!--Grid-->
                    <div class="HeaderToolbar">
                        <asp:LinkButton ID="lnkSearch" runat="server" CausesValidation="False" Text="搜索" />
                        &nbsp; <a href="#" onclick="refresh();">刷新</a>&nbsp;
                    </div>
                    <div class="HeaderGridView">
                        <asp:GridView ID="gvMaster" runat="server" SkinID="gvMaster" DataKeyNames="UserId">
                            <Columns>
                                <asp:TemplateField ItemStyle-Width="80">
                                    <HeaderTemplate>
                                        <div>
                                            <asp:Label ID="Operation" runat="server" Text="操作"></asp:Label></div>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <div>
                                            <asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit" CommandArgument='<%#Eval("UserId") %>'>编辑</asp:LinkButton>
                                            <asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete" CommandArgument='<%#Eval("UserId") %>'
                                                OnClientClick="if(!confirm('你确认要删除吗？'))return false;">删除</asp:LinkButton>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="UserId" Visible="false" />
                                <asp:TemplateField ItemStyle-Width="120px">
                                    <HeaderTemplate>
                                        用户名</HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Label ID="lblUserName" runat="server" Text='<%#Eval("aspnet_User.UserName") %>'></asp:Label></ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Email" HeaderText="Email" ItemStyle-Width="150px" />
                                <asp:BoundField DataField="LastLoginDate" HeaderText="上次登录时间" ItemStyle-Width="150px" />
                                <asp:BoundField DataField="CreateDate" HeaderText="创建时间" ItemStyle-Width="150px" />
                                <asp:TemplateField ItemStyle-Width="150px">
                                    <HeaderTemplate>
                                        上次活跃时间</HeaderTemplate>
                                    <ItemTemplate>
                                        <%#Eval("aspnet_User.LastActivityDate")%></ItemTemplate>
                                </asp:TemplateField>
                                <%--<asp:TemplateField ItemStyle-Width="80px">
                            <HeaderTemplate>
                                是否在线</HeaderTemplate>
                            <ItemTemplate>
                                <%# (DateTime)Eval("aspnet_User.LastActivityDate") < DateTime.Now.AddMinutes(-5) ? "否" : "是"%></ItemTemplate>
                        </asp:TemplateField>--%>
                            </Columns>
                            <EmptyDataTemplate>
                                <cc:EmptyData ID="EmptyData1" runat="server"></cc:EmptyData>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </div>
                    <div class="HeaderPager">
                        <cc:Pager runat="server" ID="pgrMaster" />
                    </div>
                    <div style="clear: both;">
                    </div>
                </asp:View>
                <asp:View ID="vwEntry" runat="server">
                    <%--  <uc:MenuInUsers ID="menuInUsers" runat="server" />--%>
                    <!--Title -->
                    <div class="HeaderTitle">
                        <asp:Label ID="Label1" runat="server" Text="权限管理"></asp:Label>
                    </div>
                    <asp:UpdatePanel ID="udpEntry" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
                        <ContentTemplate>
                            <asp:Panel ID="pnlEntry" runat="server" CssClass="HeaderSearch">
                                <table cellspacing="5" width="100%">
                                    <tr>
                                        <td align="right" style="width: 80px; min-width: 80px;">
                                            <asp:Label ID="lblUserName" runat="server" Text="用户"></asp:Label>
                                        </td>
                                        <td align="left">
                                            <asp:Label ID="lblDspUser" runat="server" CssClass="readonly"></asp:Label>
                                        </td>
                                    </tr>
                                     <tr>
                                        <td align="right" style="width: 80px; min-width: 80px;">
                                            <asp:Label ID="lblRole" runat="server" Text="角色"></asp:Label>
                                        </td>
                                        <td align="left">
                                            <%-- <asp:ListBox ID="ltbRole" runat="server"  SelectionMode="Multiple"  ToolTip="Ctrl+鼠标 可以多选">
                                             
                                             </asp:ListBox>--%>
                                             <asp:CheckBoxList ID="lstRole" runat="server"  RepeatColumns="8" RepeatDirection="Horizontal"  ></asp:CheckBoxList>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <!--Grid-->
                            <div class="HeaderToolbar">
                                <asp:LinkButton ID="lnkSave" runat="server" Text="保存" />&nbsp;  
                                <asp:LinkButton ID="lnkBack" runat="server" Text="后退" />&nbsp;
                            </div>
                            <div class="HeaderGridView">
                                <asp:GridView ID="gvEntry" runat="server" SkinID="gvMaster" DataKeyNames="MenuID,BelongTo">
                                    <Columns>
                                        <asp:BoundField DataField="MenuID" Visible="false" />
                                        <asp:BoundField DataField="BelongTo" Visible="false" />
                                        <asp:BoundField DataField="MenuDesc" ItemStyle-Width="150px" HeaderText="功能描述" />
                                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkReadSelectAll" ToolTip="选择所有" runat="server" />可读</HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkRead" runat="server" Checked='<%#Eval("CanRead") %>' /></ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkWriteSelectAll" ToolTip="选择所有" runat="server" />可写</HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkWrite" runat="server" Checked='<%#Eval("CanWrite") %>' /></ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkDeleteSelectAll" ToolTip="选择所有" runat="server" />可删</HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkDelete" runat="server" Checked='<%#Eval("CanDelete") %>' /></ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkExportSelectAll" ToolTip="选择所有" runat="server" />可导出数据</HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkExport" runat="server" Checked='<%#Eval("CanExport") %>' /></ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                            <div style="clear: both;">
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:View>
            </asp:MultiView>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
